var e = require("../@babel/runtime/helpers/interopRequireDefault")(require("../@babel/runtime/helpers/typeof"));

!function(t) {
    "object" == ("undefined" == typeof exports ? "undefined" : (0, e.default)(exports)) && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define([], t) : ("undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this).Qs = t();
}(function() {
    return function e(t, r, n) {
        function o(a, l) {
            if (!r[a]) {
                if (!t[a]) {
                    var c = "function" == typeof require && require;
                    if (!l && c) return c(a, !0);
                    if (i) return i(a, !0);
                    var s = new Error("Cannot find module '" + a + "'");
                    throw s.code = "MODULE_NOT_FOUND", s;
                }
                var u = r[a] = {
                    exports: {}
                };
                t[a][0].call(u.exports, function(e) {
                    return o(t[a][1][e] || e);
                }, u, u.exports, e, t, r, n);
            }
            return r[a].exports;
        }
        for (var i = "function" == typeof require && require, a = 0; a < n.length; a++) o(n[a]);
        return o;
    }({
        1: [ function(e, t, r) {
            var n = String.prototype.replace, o = /%20/g, i = e("./utils"), a = {
                RFC1738: "RFC1738",
                RFC3986: "RFC3986"
            };
            t.exports = i.assign({
                default: a.RFC3986,
                formatters: {
                    RFC1738: function(e) {
                        return n.call(e, o, "+");
                    },
                    RFC3986: function(e) {
                        return String(e);
                    }
                }
            }, a);
        }, {
            "./utils": 5
        } ],
        2: [ function(e, t, r) {
            var n = e("./stringify"), o = e("./parse"), i = e("./formats");
            t.exports = {
                formats: i,
                parse: o,
                stringify: n
            };
        }, {
            "./formats": 1,
            "./parse": 3,
            "./stringify": 4
        } ],
        3: [ function(e, t, r) {
            function n(e, t, r) {
                if (e) {
                    var n = r.allowDots ? e.replace(/\.([^.[]+)/g, "[$1]") : e, o = /(\[[^[\]]*])/g, a = 0 < r.depth && /(\[[^[\]]*])/.exec(n), l = a ? n.slice(0, a.index) : n, c = [];
                    if (l) {
                        if (!r.plainObjects && i.call(Object.prototype, l) && !r.allowPrototypes) return;
                        c.push(l);
                    }
                    for (var s = 0; 0 < r.depth && null !== (a = o.exec(n)) && s < r.depth; ) {
                        if (s += 1, !r.plainObjects && i.call(Object.prototype, a[1].slice(1, -1)) && !r.allowPrototypes) return;
                        c.push(a[1]);
                    }
                    return a && c.push("[" + n.slice(a.index) + "]"), function(e, t, r) {
                        for (var n = t, o = e.length - 1; 0 <= o; --o) {
                            var i, a = e[o];
                            if ("[]" === a && r.parseArrays) i = [].concat(n); else {
                                i = r.plainObjects ? Object.create(null) : {};
                                var l = "[" === a.charAt(0) && "]" === a.charAt(a.length - 1) ? a.slice(1, -1) : a, c = parseInt(l, 10);
                                r.parseArrays || "" !== l ? !isNaN(c) && a !== l && String(c) === l && 0 <= c && r.parseArrays && c <= r.arrayLimit ? (i = [])[c] = n : i[l] = n : i = {
                                    0: n
                                };
                            }
                            n = i;
                        }
                        return n;
                    }(c, t, r);
                }
            }
            var o = e("./utils"), i = Object.prototype.hasOwnProperty, a = {
                allowDots: !1,
                allowPrototypes: !1,
                arrayLimit: 20,
                charset: "utf-8",
                charsetSentinel: !1,
                comma: !1,
                decoder: o.decode,
                delimiter: "&",
                depth: 5,
                ignoreQueryPrefix: !1,
                interpretNumericEntities: !1,
                parameterLimit: 1e3,
                parseArrays: !0,
                plainObjects: !1,
                strictNullHandling: !1
            };
            t.exports = function(e, t) {
                var r = function(e) {
                    if (!e) return a;
                    if (null !== e.decoder && void 0 !== e.decoder && "function" != typeof e.decoder) throw new TypeError("Decoder has to be a function.");
                    if (void 0 !== e.charset && "utf-8" !== e.charset && "iso-8859-1" !== e.charset) throw new Error("The charset option must be either utf-8, iso-8859-1, or undefined");
                    var t = void 0 === e.charset ? a.charset : e.charset;
                    return {
                        allowDots: void 0 === e.allowDots ? a.allowDots : !!e.allowDots,
                        allowPrototypes: "boolean" == typeof e.allowPrototypes ? e.allowPrototypes : a.allowPrototypes,
                        arrayLimit: "number" == typeof e.arrayLimit ? e.arrayLimit : a.arrayLimit,
                        charset: t,
                        charsetSentinel: "boolean" == typeof e.charsetSentinel ? e.charsetSentinel : a.charsetSentinel,
                        comma: "boolean" == typeof e.comma ? e.comma : a.comma,
                        decoder: "function" == typeof e.decoder ? e.decoder : a.decoder,
                        delimiter: "string" == typeof e.delimiter || o.isRegExp(e.delimiter) ? e.delimiter : a.delimiter,
                        depth: "number" == typeof e.depth || !1 === e.depth ? +e.depth : a.depth,
                        ignoreQueryPrefix: !0 === e.ignoreQueryPrefix,
                        interpretNumericEntities: "boolean" == typeof e.interpretNumericEntities ? e.interpretNumericEntities : a.interpretNumericEntities,
                        parameterLimit: "number" == typeof e.parameterLimit ? e.parameterLimit : a.parameterLimit,
                        parseArrays: !1 !== e.parseArrays,
                        plainObjects: "boolean" == typeof e.plainObjects ? e.plainObjects : a.plainObjects,
                        strictNullHandling: "boolean" == typeof e.strictNullHandling ? e.strictNullHandling : a.strictNullHandling
                    };
                }(t);
                if ("" === e || null == e) return r.plainObjects ? Object.create(null) : {};
                for (var l = "string" == typeof e ? function(e, t) {
                    var r, n = {}, l = t.ignoreQueryPrefix ? e.replace(/^\?/, "") : e, c = t.parameterLimit === 1 / 0 ? void 0 : t.parameterLimit, s = l.split(t.delimiter, c), u = -1, f = t.charset;
                    if (t.charsetSentinel) for (r = 0; r < s.length; ++r) 0 === s[r].indexOf("utf8=") && ("utf8=%E2%9C%93" === s[r] ? f = "utf-8" : "utf8=%26%2310003%3B" === s[r] && (f = "iso-8859-1"), 
                    u = r, r = s.length);
                    for (r = 0; r < s.length; ++r) if (r !== u) {
                        var p, d, y = s[r], m = y.indexOf("]="), h = -1 === m ? y.indexOf("=") : m + 1;
                        (d = -1 === h ? (p = t.decoder(y, a.decoder, f, "key"), t.strictNullHandling ? null : "") : (p = t.decoder(y.slice(0, h), a.decoder, f, "key"), 
                        t.decoder(y.slice(h + 1), a.decoder, f, "value"))) && t.interpretNumericEntities && "iso-8859-1" === f && (d = d.replace(/&#(\d+);/g, function(e, t) {
                            return String.fromCharCode(parseInt(t, 10));
                        })), d && t.comma && -1 < d.indexOf(",") && (d = d.split(",")), i.call(n, p) ? n[p] = o.combine(n[p], d) : n[p] = d;
                    }
                    return n;
                }(e, r) : e, c = r.plainObjects ? Object.create(null) : {}, s = Object.keys(l), u = 0; u < s.length; ++u) {
                    var f = s[u], p = n(f, l[f], r);
                    c = o.merge(c, p, r);
                }
                return o.compact(c);
            };
        }, {
            "./utils": 5
        } ],
        4: [ function(t, r, n) {
            function o(e, t) {
                f.apply(e, u(t) ? t : [ t ]);
            }
            function i(t, r, n, l, c, s, f, p, d, m, h, b, g) {
                var v = t;
                if ("function" == typeof f ? v = f(r, v) : v instanceof Date ? v = m(v) : "comma" === n && u(v) && (v = v.join(",")), 
                null === v) {
                    if (l) return s && !b ? s(r, y.encoder, g, "key") : r;
                    v = "";
                }
                if (function(t) {
                    return "string" == typeof t || "number" == typeof t || "boolean" == typeof t || "symbol" == (0, 
                    e.default)(t) || "bigint" == typeof t;
                }(v) || a.isBuffer(v)) return s ? [ h(b ? r : s(r, y.encoder, g, "key")) + "=" + h(s(v, y.encoder, g, "value")) ] : [ h(r) + "=" + h(String(v)) ];
                var O, j = [];
                if (void 0 === v) return j;
                if (u(f)) O = f; else {
                    var w = Object.keys(v);
                    O = p ? w.sort(p) : w;
                }
                for (var x = 0; x < O.length; ++x) {
                    var N = O[x];
                    c && null === v[N] || (u(v) ? o(j, i(v[N], "function" == typeof n ? n(r, N) : r, n, l, c, s, f, p, d, m, h, b, g)) : o(j, i(v[N], r + (d ? "." + N : "[" + N + "]"), n, l, c, s, f, p, d, m, h, b, g)));
                }
                return j;
            }
            var a = t("./utils"), l = t("./formats"), c = Object.prototype.hasOwnProperty, s = {
                brackets: function(e) {
                    return e + "[]";
                },
                comma: "comma",
                indices: function(e, t) {
                    return e + "[" + t + "]";
                },
                repeat: function(e) {
                    return e;
                }
            }, u = Array.isArray, f = Array.prototype.push, p = Date.prototype.toISOString, d = l.default, y = {
                addQueryPrefix: !1,
                allowDots: !1,
                charset: "utf-8",
                charsetSentinel: !1,
                delimiter: "&",
                encode: !0,
                encoder: a.encode,
                encodeValuesOnly: !1,
                format: d,
                formatter: l.formatters[d],
                indices: !1,
                serializeDate: function(e) {
                    return p.call(e);
                },
                skipNulls: !1,
                strictNullHandling: !1
            };
            r.exports = function(t, r) {
                var n, a = t, f = function(e) {
                    if (!e) return y;
                    if (null !== e.encoder && void 0 !== e.encoder && "function" != typeof e.encoder) throw new TypeError("Encoder has to be a function.");
                    var t = e.charset || y.charset;
                    if (void 0 !== e.charset && "utf-8" !== e.charset && "iso-8859-1" !== e.charset) throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
                    var r = l.default;
                    if (void 0 !== e.format) {
                        if (!c.call(l.formatters, e.format)) throw new TypeError("Unknown format option provided.");
                        r = e.format;
                    }
                    var n = l.formatters[r], o = y.filter;
                    return "function" != typeof e.filter && !u(e.filter) || (o = e.filter), {
                        addQueryPrefix: "boolean" == typeof e.addQueryPrefix ? e.addQueryPrefix : y.addQueryPrefix,
                        allowDots: void 0 === e.allowDots ? y.allowDots : !!e.allowDots,
                        charset: t,
                        charsetSentinel: "boolean" == typeof e.charsetSentinel ? e.charsetSentinel : y.charsetSentinel,
                        delimiter: void 0 === e.delimiter ? y.delimiter : e.delimiter,
                        encode: "boolean" == typeof e.encode ? e.encode : y.encode,
                        encoder: "function" == typeof e.encoder ? e.encoder : y.encoder,
                        encodeValuesOnly: "boolean" == typeof e.encodeValuesOnly ? e.encodeValuesOnly : y.encodeValuesOnly,
                        filter: o,
                        formatter: n,
                        serializeDate: "function" == typeof e.serializeDate ? e.serializeDate : y.serializeDate,
                        skipNulls: "boolean" == typeof e.skipNulls ? e.skipNulls : y.skipNulls,
                        sort: "function" == typeof e.sort ? e.sort : null,
                        strictNullHandling: "boolean" == typeof e.strictNullHandling ? e.strictNullHandling : y.strictNullHandling
                    };
                }(r);
                "function" == typeof f.filter ? a = (0, f.filter)("", a) : u(f.filter) && (n = f.filter);
                var p, d = [];
                if ("object" != (0, e.default)(a) || null === a) return "";
                p = r && r.arrayFormat in s ? r.arrayFormat : r && "indices" in r ? r.indices ? "indices" : "repeat" : "indices";
                var m = s[p];
                n = n || Object.keys(a), f.sort && n.sort(f.sort);
                for (var h = 0; h < n.length; ++h) {
                    var b = n[h];
                    f.skipNulls && null === a[b] || o(d, i(a[b], b, m, f.strictNullHandling, f.skipNulls, f.encode ? f.encoder : null, f.filter, f.sort, f.allowDots, f.serializeDate, f.formatter, f.encodeValuesOnly, f.charset));
                }
                var g = d.join(f.delimiter), v = !0 === f.addQueryPrefix ? "?" : "";
                return f.charsetSentinel && ("iso-8859-1" === f.charset ? v += "utf8=%26%2310003%3B&" : v += "utf8=%E2%9C%93&"), 
                0 < g.length ? v + g : "";
            };
        }, {
            "./formats": 1,
            "./utils": 5
        } ],
        5: [ function(t, r, n) {
            function o(e, t) {
                for (var r = t && t.plainObjects ? Object.create(null) : {}, n = 0; n < e.length; ++n) void 0 !== e[n] && (r[n] = e[n]);
                return r;
            }
            var i = Object.prototype.hasOwnProperty, a = Array.isArray, l = function() {
                for (var e = [], t = 0; t < 256; ++t) e.push("%" + ((t < 16 ? "0" : "") + t.toString(16)).toUpperCase());
                return e;
            }();
            r.exports = {
                arrayToObject: o,
                assign: function(e, t) {
                    return Object.keys(t).reduce(function(e, r) {
                        return e[r] = t[r], e;
                    }, e);
                },
                combine: function(e, t) {
                    return [].concat(e, t);
                },
                compact: function(t) {
                    for (var r = [ {
                        obj: {
                            o: t
                        },
                        prop: "o"
                    } ], n = [], o = 0; o < r.length; ++o) for (var i = r[o], l = i.obj[i.prop], c = Object.keys(l), s = 0; s < c.length; ++s) {
                        var u = c[s], f = l[u];
                        "object" == (0, e.default)(f) && null !== f && -1 === n.indexOf(f) && (r.push({
                            obj: l,
                            prop: u
                        }), n.push(f));
                    }
                    return function(e) {
                        for (;1 < e.length; ) {
                            var t = e.pop(), r = t.obj[t.prop];
                            if (a(r)) {
                                for (var n = [], o = 0; o < r.length; ++o) void 0 !== r[o] && n.push(r[o]);
                                t.obj[t.prop] = n;
                            }
                        }
                    }(r), t;
                },
                decode: function(e, t, r) {
                    var n = e.replace(/\+/g, " ");
                    if ("iso-8859-1" === r) return n.replace(/%[0-9a-f]{2}/gi, unescape);
                    try {
                        return decodeURIComponent(n);
                    } catch (e) {
                        return n;
                    }
                },
                encode: function(t, r, n) {
                    if (0 === t.length) return t;
                    var o = t;
                    if ("symbol" == (0, e.default)(t) ? o = Symbol.prototype.toString.call(t) : "string" != typeof t && (o = String(t)), 
                    "iso-8859-1" === n) return escape(o).replace(/%u[0-9a-f]{4}/gi, function(e) {
                        return "%26%23" + parseInt(e.slice(2), 16) + "%3B";
                    });
                    for (var i = "", a = 0; a < o.length; ++a) {
                        var c = o.charCodeAt(a);
                        45 === c || 46 === c || 95 === c || 126 === c || 48 <= c && c <= 57 || 65 <= c && c <= 90 || 97 <= c && c <= 122 ? i += o.charAt(a) : c < 128 ? i += l[c] : c < 2048 ? i += l[192 | c >> 6] + l[128 | 63 & c] : c < 55296 || 57344 <= c ? i += l[224 | c >> 12] + l[128 | c >> 6 & 63] + l[128 | 63 & c] : (a += 1, 
                        c = 65536 + ((1023 & c) << 10 | 1023 & o.charCodeAt(a)), i += l[240 | c >> 18] + l[128 | c >> 12 & 63] + l[128 | c >> 6 & 63] + l[128 | 63 & c]);
                    }
                    return i;
                },
                isBuffer: function(t) {
                    return !(!t || "object" != (0, e.default)(t) || !(t.constructor && t.constructor.isBuffer && t.constructor.isBuffer(t)));
                },
                isRegExp: function(e) {
                    return "[object RegExp]" === Object.prototype.toString.call(e);
                },
                merge: function t(r, n, l) {
                    if (!n) return r;
                    if ("object" != (0, e.default)(n)) {
                        if (a(r)) r.push(n); else {
                            if (!r || "object" != (0, e.default)(r)) return [ r, n ];
                            (l && (l.plainObjects || l.allowPrototypes) || !i.call(Object.prototype, n)) && (r[n] = !0);
                        }
                        return r;
                    }
                    if (!r || "object" != (0, e.default)(r)) return [ r ].concat(n);
                    var c = r;
                    return a(r) && !a(n) && (c = o(r, l)), a(r) && a(n) ? (n.forEach(function(n, o) {
                        if (i.call(r, o)) {
                            var a = r[o];
                            a && "object" == (0, e.default)(a) && n && "object" == (0, e.default)(n) ? r[o] = t(a, n, l) : r.push(n);
                        } else r[o] = n;
                    }), r) : Object.keys(n).reduce(function(e, r) {
                        var o = n[r];
                        return i.call(e, r) ? e[r] = t(e[r], o, l) : e[r] = o, e;
                    }, c);
                }
            };
        }, {} ]
    }, {}, [ 2 ])(2);
});